<?php
	session_start();
    require("libraries/config.php");
	require("libraries/database.php");
	require("models/user.php");
	$user = $_POST['username'];
	$pass = md5($_POST['password']);
	$db   = new model_user;
	$data = $db->check_login($user,$pass);
	if($data == FALSE){
		echo "false";
	}else{
		echo "true";
		$_SESSION['ses_userid'] = $data['mataikhoan'];
		$_SESSION['ses_user']   = $data['tentaikhoan'];
		$_SESSION['ses_level']  = $data['capdo'];
	}	
?>